[ Mega Script
Archive ] [ Readme's
] [ Counter
]
##############################################################################
# Counter Version 1.1.1 #
# Copyright 1996 Matt Wright mattw@worldwidemart.com #
# Created 10/27/95 Last Modified 4/25/96 #
# Scripts Archive at: http://www.worldwidemart.com/scripts/ #
##############################################################################
# If you run into any problems while trying to configure this scripts, help #
# is available. The steps you should take to get the fastest results, are: #
# 1) Read this file thoroughly #
# 2) Consult the Matt's Script Archive Frequently Asked Questions: #
# http://www.worldwidemart.com/scripts/faq/ #
# 3) If you are still having difficulty installing this script, send #
# e-mail to: scripts-help@tahoenet.com #
# Include any error messages you are receiving and as much detail #
# as you can so we can spot your problem. Also include the variable#
# configuration block that is located at the top of the script. #
# #
# Hopefully we will be able to help you solve your problems. Thank you. #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1996 Matthew M. Wright All Rights Reserved. #
# #
# Counter may be used and modified free of charge by anyone so long as #
# this copyright notice and the comments above remain intact. By using this #
# code you agree to indemnify Matthew M. Wright from any liability that #
# might arise from it's use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact.#
##############################################################################
This counter script is built for users to be able
to create a counter program in-lined into their home
page without having to use Server Side Includes.
To use this counter program, you will need to go
get a program called FLY, which allows an easy
interface into the GD graphics library, which is
written in C. I easily compiled fly without any
problems on several different machines: SunOS, OSF
3.2, and more. You can get FLY at:
http://www.unimelb.edu.au/fly/fly.html
But it is necessary to have this or else my
counter program will not work. Version 1.1 of my
counter program was written to correspond with
version 1.1 of FLY and you will need to upgrade if
you are still using version 1.0 of FLY.
My counter program comes with 7 files:
- counter.pl - The Counter Program Itself.
- count.txt - The data file that holds the
counter number.
- access_log - Log file of accesses to your
counter.
- error_log - Log file of errors your counter
has produced.
- html_log.pl - Produce nice HTML file of
access_log.
- bad_referer.gif - The Bad Referer Error Image
- README - Detailed Installation Instructions
(This file)
- There is also an explanation about digits.
Each file requires something to be done to it. Below
is a description of how to install the counter
program and make it work on your system.
- If you wish to start with a different number than
1, simply open up this file and type in your new
counter number. Then the script will display this
number the next time.
- This file can be used to generate a nice HTML 3
Table formatted document of your access_log. It
still looks nice in other browsers that do not
support 3.0 though. There is a little configuring
you will have to do with this file. The major
change in this file from version 1.0 is that you
can choose whether you woudl like to be able to
access this file through the web or run it at the
prompt. If you have huge stat files you will
probably wan tot run it at a unix prompt and
redirect the output to a file, so that you don't
have to regenerate stats every time you want to
view them. ON the other hand, if you don't have
telnet access or dial up access to a unix prompt
you will want to set the $web option to 1 so that
you can just call this script through the web and
it will generate the stats on the fly.
- $web = 1;
- This option allows you to configure
the script to either run from the web
or to be used as a program that you
run at the prompt and redirect
output. If you choose to set this to
'1', then you can simply call the
program as a web page, however if you
choose to set this to 0, you should
run this at the prompt like:
html_log.pl > stats.html
- $log_file =
"/home/user/counter/access_log";
- This should be defined exactly the
same as you defined $access_log in
your counter.pl file. Simply the
system path to the access_log file
that my counter program creates.
- $min_remote
= "10";
- This is the minimum number of
accesses a remote host must have for
them to make your html list.
- $min_agent
= "5";
- This is the minimum number of times a
browser must access your page before
it shows up in your list of browsers
accessing your page.
- $expand_agent
= 0;
- If this is set to zero, then the user
agents will be grouped by the main
portion of their USER_AGENT
environment variable. If you set this
to 1, then they will stay as is and
you will see several entries of the
same browser, but for different
platforms. Setting it to 0 provides a
much nicer and more compact read out.
- $show_percent
= 1;
- This will allow you to show the
percentage that a certain item takes
up. For instance, if you have 5000
accesses to your page and 500 of them
are from someone else's page, a 10%
will be shown next to it, if you set
this variable to 1. Setting it to
zero makes it more compact, but in my
opinion, setting it to 1 is nice.
- $title =
"Access Statistics for My Home
Page";
- Title provides the title and heading
for your access statistics page.
- $title_url
=
"http://my.domain.com/mypage.html";
- This is the url to the page in which
you are showing accesses. For
instance, if I have the counter on:
http://my.domain.com/mypage.html. You
would set this variable to that page.
These files simply need to be placed in the spot
that is indicated in the $access_log and $error_log
variables in counter.pl. They also need to be chmoded
777 so that they can be written to by the web server
uid. The directory they are in should also be chmoded
777.
This image file needs to be placed in the spot
indicated by the $bad_referer.gif variables in the
counter.pl file. It needs to be chmoded 744 so that
it is readable by everyone and so that the web server
can link to them in case of a time out.
My program does not currently come with a standard
set of digits. This is because I just haven't had the
time to make a bunch of counter images. There are
plenty of places out on the internet that provide
free counter images, and all you have to do, is
download a set of them, configure the directory they
are in, change all the names to 0.gif - 9.gif and
then get the width and height in pixels. Many
graphics programs can easily do this. Here are some
sites below that have counter digits:
- YAHOO
- They have a lot of links to counter places.
- DIGIT
MANIA
- Great counter images, all in one place!
Let me know if you have any problems with the
counter images!
I accidentally left out the part about how to call
this program in my previous release. You simply can
call this program like you would call any other image
or background picture. Examples are shown below:
<img src="http://www.your.host.com/path/to/counter.pl">
That will give you the standard counter image,
andyou can put <center> tags around it or
position it however you like on your web page.
You can also make your counter the bacground image
for your page, although it will probably look pretty
tacky, just use:
<body background="http://www.your.host.com/path/to/counter.pl">
VERSION 1.0 - 11/25/95 - Released the first version of this script.
VERSION 1.1 - 12/31/95 - Version fixed to run with new version of
FLY.
- Problems with time outs and images not
getting erased partly solved.
- Description of how to put the counter
image into your web page added.
- Other Minor Details Fixed.
VERSION 1.1.1 - 1/11/96 - Small Bug in HTML_LOG.pl Fixed.
- 4/25/96 - URL to Digit Mania Fixed.
[ Mega
Script Archive ]
|